<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<style>
    .btn {
        position: absolute;
        top: 30%;
        left: 30%;
        background: red;
        color: #FFFFFF;
        text-align: center;
        line-height: 50px;
        width: 200px;
        height: 50px;
        border-radius: 10px;
        cursor: pointer;
    }
</style>
<body>
<div class="btn" onclick="handleClick()">
    点击
</div>
</body>
</html>
<script>
    function scrollFn() {
        console.log(new Date());
    };

    function throttle(fn, interval) {
        var timer;
        return function () {
            if (timer) {
                return false;
            }
            timer = setTimeout(function () {
                console.log("throttle---");
                fn.apply();
                clearTimeout(timer);
                timer = null;
            }, interval)
        }
    }

    function handleClick() {
        throttle(scrollFn(), 5000)
        throttle(scrollFn(), 5000)
        throttle(scrollFn(), 5000)
    }
</script>
